
let R = require('ramda');



let str = "My name is zhangsan.";


let head = function (str) {
    return str[0]
};

let toUpper = function (str) {
    return str.toUpperCase()
};

let split = function(str){
    return str.split(" ")
};

// let change = R.compose(R.join(' .'),R.map(toUpper),R.map(head),split);
// console.log(change(str));

// alias
let compose = R.compose;
let map = R.map;
let curry = R.curry;

let trace = curry(function (tag,x) {
   console.log(tag,x);
   return x;
});

let headToUpper = compose(toUpper,trace("after_head"),head);
let tran = compose(map(headToUpper),trace("after_split"),split);
console.log(tran(str));


